import { ProFormDateTimeRangePicker } from "@ant-design/pro-components";

const C_ProFormDateTimeRangePicker: React.FC<
  React.ComponentProps<typeof ProFormDateTimeRangePicker> & {
    value?: any;
  }
> = function C_ProFormDateTimeRangePicker(props) {
  return (
    <ProFormDateTimeRangePicker
      {...props}
      fieldProps={{
        minuteStep: 5,
        hideDisabledOptions: true,
        disabledTime: () => ({
          disabledHours: () => [0, 1, 2, 3, 4, 5, 6],
          disabledMinutes: () => [],
          disabledSeconds: () =>
            Array.from(new Array(60)).map((_, item) => item + 1),
        }),
        ...props.fieldProps,
      }}
      transform={(value, namePath, allValues) => {
        return {
          [namePath]: value,
        };
      }}
    />
  );
};

export default C_ProFormDateTimeRangePicker;
